package com.cml.domain.entity;

import com.cml.common.dto.entity.ServiceInstance;
import com.cml.domain.service.ServiceInstanceManagerService;

/**
 * 姓名：陈茂林
 * 时间：2023/10/13 8:55
 * 描述：
 */
public class Solt {


    private Integer solt;

    private Integer replicasServerNodeId;

    private  ServiceInstanceManagerService serviceInstanceManagerService;

    public Solt(int soltNo,ServiceInstanceManagerService serviceInstanceManagerService) {
        this.solt=soltNo;
        this.serviceInstanceManagerService=serviceInstanceManagerService;
    }

    public Integer getSolt() {
        return solt;
    }

    public Integer getReplicasServerNodeId() {
        return replicasServerNodeId;
    }

    public void setReplicasServerNodeId(Integer replicasServerNodeId) {
        this.replicasServerNodeId = replicasServerNodeId;
    }

    public boolean registerServiceInstance(ServiceInstance serviceInstance){
        return serviceInstanceManagerService.registerServiceInstance(serviceInstance);
    }

    public void hearbeat(ServiceInstance serviceInstance){
        serviceInstanceManagerService.hearbeat(serviceInstance);
    }

    public void subscribe(Session session,String serviceName){
        serviceInstanceManagerService.subscribe(session,serviceName);
    }
}
